package com.example.demo;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@RestController
@WebServlet("/RequestDemo1")
public class RequestDemo1 extends HttpServlet {
//public class HelloController {
//    @RequestMapping("hello")
//    public String say() {
//        System.out.println("Hello World!");
//        return "Hello World!";
//    }

        @RequestMapping("byebye")
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException{
//        System.out.println("0");
//        String test0= request.getQueryString();
//        System.out.println(test0);
        String[] test1= request.getParameterValues("test1");
//        System.out.println(test1[0]);
        if(test1[0].equals("1")){
            System.out.println("111111111");
        } else if (test1[0].equals("1.2")) {
            System.out.println("1.2，1.2，1.2，1.2，");
        } else if (test1[0].equals("2")) {
            System.out.println("22222222");
        } else {
            System.out.println(test1[0]);
        }
      }
//    @RequestMapping("byebye")
//    public String byebye() {
//        return "byebye!";
//    }

}
